from django.db import models


class BaseModel(models.Model):
    '''
    自定义抽象基类 可以继承
    '''
    create_time = models.DateTimeField(auto_now_add=True,verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True,verbose_name='修改时间')
    create_by = models.CharField(max_length=64,blank=True, verbose_name='创建人')
    update_by = models.CharField(max_length=64,blank=True,verbose_name='修改人')
    remark = models.CharField(max_length=64,blank=True,verbose_name='备注')
    class Meta:
        abstract = True #抽象类

# class BaseModelSerializer(serializers.ModelSerializer):
#     create_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
#     update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
#
#     class Meta:
#         model = BaseModel
#         fields = '__all__'
